﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="user.aspx.cs" Inherits="text.user" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="box_right col-xs-9 ">


    <!--用户列表-->
    <div class="segment3">
        <div class="table-responsive" style="padding: 0 10px;">
            <table class="table">
                <thead>
                    <tr>
                        <th></th>
                        <th>用户名</th>
                        <th>邮箱</th>
                        <th>出生日期</th>
                        <th>电话</th>
                        <th>最后登录</th>
                        <th>操作</th>
                    </tr>
                </thead>

                <tbody>
               <asp:Repeater ID="rptNote" runat="server" OnItemDataBound="rptNote_ItemDataBound" OnItemCommand="rptNote_ItemCommand">
                        <ItemTemplate>
                            <tr class="mylist">
                                <td>
                                    <asp:CheckBox ID="cbxItem" runat="server" CssClass="checkItem" />
                                <td><%#Eval("account") %></td>
                                <td><%#Eval("email") %></td>
                                <td><%#Eval("birthday") %></td>
                                <td><%#Eval("phone") %></td>
                                <td><%#Convert.ToDateTime( Eval("last_login_time")).ToString("yyyy-MM-dd") %></td>
                                <td>
                             <asp:HiddenField ID="hfUserId" runat="server" Value='<%#Eval("id") %>' />
                                    <asp:HiddenField ID="hfNoteId" runat="server" Value='<%#Eval("id") %>' />
                                    <asp:LinkButton ID="LinkButton1" CommandName="delete" CommandArgument='<%#Eval("id") %>' runat="server">删除</asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton2" CommandName="update" CommandArgument='<%#Eval("id") %>' runat="server">查看</asp:LinkButton>
                                 <%--   <a id="a" href='info.aspx?id=<%#Eval("id") %>'>查看</a></td>--%>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </tbody>

            </table>
            <div class="clear"></div>
            <div class="case_page">
                <div class="page_left">
                         <input type="button" value="全选" onclick="checkAll(true)" />
                    <input type="button" value="全不选" onclick="checkAll(false)" />
                    <input type="button" value="反选" onclick="checkRevAll()" />
                    <span class="glyphicon glyphicon-trash"></span>
                    <asp:Button ID="Button1" CssClass="btn btn-danger" runat="server" Text="删除" OnClick="Button1_Click" />
                </div>
                <div class="page_right">
                    <ul class="pagination">
                        <li><a href="#">«</a></li>
                        <li class="active"><a href="#">1</a></li>
                        <li><a href="#">2</a></li>
                        <li><a href="#">3</a></li>
                        <li><a href="#">4</a></li>
                        <li><a href="#">5</a></li>
                        <li><a href="#">»</a></li>
                    </ul>
                </div>
            </div>

        </div>
    </div>

    <script type="text/javascript">

        function checkAll(flag) {
            //1.找到所有的勾选框
            var checkeds = document.getElementsByClassName("checkItem");
            for (var item of checkeds) {
                item.children[0].checked = flag;
            }
        }
        function checkRevAll() {
            //1.找到所有的勾选框
            var checkeds = document.getElementsByClassName("checkItem");
            for (var item of checkeds) {
                item.children[0].checked = !item.children[0].checked;
            }
        }
    </script>

</div>
</asp:Content>
